<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../vue.js"></script>
</head>
<body>
<div id="app">
    <body-content>
        <div class="header" slot="header">header</div>
        <div class="footer" slot="footer">footer</div>
    </body-content>
</div>

<script>
    Vue.component('body-content',{
        template:`<div>
        <slot name="header">
            <h1>默认值</h1>
        </slot>
        <div class="content">content</div>
        <slot name="footer"></slot>
    </div>`
    })
    var vm = new Vue({
        el: "#app",
        data: {}
    })
</script>
</body>
</html>